/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-11-16
 * Time: 17:20
 */
public class Recursion {
    public static int sum(int n) {
        if (n == 1) {
           return 1;
        }
        return n + sum(--n);
    }
    public static void main(String[] args) {
        int n = 10;
        System.out.println(sum(n));
    }
}
